/*************************************************************************
 *  Copyright (C), 2017-2018, Mogoson tech. Co., Ltd.
 *  FileName: RoamBehaviour.cs
 *  Author: Mogoson   Version: 1.0   Date: 7/12/2017
 *  Version Description:
 *    Internal develop version,mainly to achieve its function.
 *  File Description:
 *    Ignore.
 *  Class List:
 *    <ID>           <name>             <description>
 *     1.         RoamBehaviour            Ignore.
 *  Function List:
 *    <class ID>     <name>             <description>
 *     1.
 *  History:
 *    <ID>    <author>      <time>      <version>      <description>
 *     1.     Mogoson     7/12/2017       1.0        Build this file.
 *************************************************************************/

namespace Developer.AreaRoam
{
    using UnityEngine;

    [AddComponentMenu("Developer/AreaRoam/RoamBehaviour")]
    [RequireComponent(typeof(Roam))]
    public class RoamBehaviour : AnimatorBehaviour
    {
        #region Property and Field
        /// <summary>
        /// Roam attach this gameobject.
        /// </summary>
        protected Roam roam;
        #endregion

        #region Protected Method
        protected override void Start()
        {
            roam = GetComponent<Roam>();
            base.Start();
        }

        /// <summary>
        /// Override the roam speed.
        /// </summary>
        /// <param name="speed">Behaviour speed.</param>
        protected override void OverrideSpeed(float speed)
        {
            roam.speed = speed;
        }
        #endregion
    }//class_end
}//namespace_end